$(function () {
    var link, label, linkRow;
    link = $('form fieldset table a').get(0);
    label = $('form fieldset table tr:first-child td:first-child').get(0);
    label = label.innerHTML;
    linkRow = link.parentNode.parentNode;
    $('form fieldset table a').bind('click', function () {
        var row, cell, input;
        row = document.createElement('tr');
        cell = document.createElement('td');
        cell.innerHTML = label;
        row.appendChild(cell);
        cell = document.createElement('td');
        input = document.createElement('input');
        input.type = 'text';
        input.name = 'option[]';
        cell.appendChild(input);
        row.appendChild(cell);
        linkRow.parentNode.insertBefore(row, linkRow);
        return false;
    });
});